@import '/static/iconfont/iconfont.css';

@font-face {
    font-family: 'REGULAR';
    font-style: normal;
    src: url('/static/fonts/SOURCEHANSANSCN-REGULAR.OTF') format('truetype');
}

@font-face {
    font-family: 'BAHNSCHRIFT';
    font-style: normal;
    src: url('/static/fonts/BAHNSCHRIFT.TTF') format('truetype');
}

*,
body {
    font-family: REGULAR !important;
}

*,
body {
    &:not(::before),
    &:not(::after) {
        font-family:
            v-sans,
            system-ui,
            -apple-system,
            BlinkMacSystemFont,
            'Segoe UI',
            sans-serif,
            'Apple Color Emoji',
            'Segoe UI Emoji',
            'Segoe UI Symbol' !important;
    }
}

//路由动画
/* fade */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease-in-out;
}
.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* fade-slide */
.fade-slide-leave-active,
.fade-slide-enter-active {
    transition: all 0.3s;
}
.fade-slide-enter-from {
    opacity: 0;
    transform: translateX(-30px);
}
.fade-slide-leave-to {
    opacity: 0;
    transform: translateX(30px);
}

/* fade-bottom */
.fade-bottom-enter-active,
.fade-bottom-leave-active {
    transition:
        opacity 0.25s,
        transform 0.3s;
}
.fade-bottom-enter-from {
    opacity: 0;
    transform: translateY(-10%);
}
.fade-bottom-leave-to {
    opacity: 0;
    transform: translateY(10%);
}

/* fade-scale */
.fade-scale-leave-active,
.fade-scale-enter-active {
    transition: all 0.28s;
}
.fade-scale-enter-from {
    opacity: 0;
    transform: scale(1.2);
}
.fade-scale-leave-to {
    opacity: 0;
    transform: scale(0.8);
}

/* zoom-fade */
.zoom-fade-enter-active,
.zoom-fade-leave-active {
    transition:
        transform 0.2s,
        opacity 0.3s ease-out;
}
.zoom-fade-enter-from {
    opacity: 0;
    transform: scale(0.92);
}
.zoom-fade-leave-to {
    opacity: 0;
    transform: scale(1.06);
}

/* zoom-out */
.zoom-out-enter-active,
.zoom-out-leave-active {
    transition:
        opacity 0.1s ease-in-out,
        transform 0.15s ease-out;
}
.zoom-out-enter-from,
.zoom-out-leave-to {
    opacity: 0;
    transform: scale(0);
}

//TransitionGroup
.list-move, /* 对移动中的元素应用的过渡 */
.list-enter-active,
.list-leave-active {
    transition: all 0.5s ease-in-out;
}

.list-enter-from,
.list-leave-to {
    opacity: 0;
    transform: translateX(30px);
}

/* 确保将离开的元素从布局流中删除
  以便能够正确地计算移动的动画。 */
.list-leave-active {
    position: absolute;
}

//全屏加载
.body-spin-content {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
}

//定制小按钮
.small-button {
    padding: 0 8px;
    font-size: 12px;
    .iconfont {
        font-size: 14px;
    }
    .n-button__icon {
        margin-right: 4px;
    }
}

.n-menu .n-menu-item-content {
    display: flex;
}

.dropdown-render-label {
    display: flex;
    align-items: center;
    i {
        margin-right: 8px;
        color: var(--text-color-base);
    }
}

.n-button {
    .iconfont {
        font-size: 14px;
    }
    //按钮节流
    // animation: button-throttle 0.5s step-end forwards;
    // &:active {
    //     animation: none;
    // }
}
//按钮节流
@keyframes button-throttle {
    from {
        pointer-events: none;
    }
    to {
        pointer-events: all;
    }
}

//表格头显示列筛选
.table-filter-popup-content {
    padding: 0px 5px;
    .title {
        margin-bottom: 10px;
        position: relative;
        padding-bottom: 8px;
        color: #333;
        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: -20px;
            right: -20px;
            height: 1px;
            transform: scaleY(0.5);
            background-color: var(--border-color);
        }
    }
    .checkbox-content {
        .item {
            margin-bottom: 4px;
            &:last-child {
                margin-bottom: 0;
            }
        }
    }
    .btn-content {
        margin-top: 10px;
        padding-top: 10px;
        display: flex;
        gap: 0 10px;
        position: relative;
        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: -20px;
            right: -20px;
            height: 1px;
            transform: scaleY(0.5);
            background-color: var(--border-color);
        }
    }
}

//分页器容器
.pagination-content00 {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

//地图popup
.mapboxgl-popup {
    .mapboxgl-popup-content {
        border-radius: 2px !important;
        box-shadow: 0 0 8px #ccc !important;
        padding: 16px 24px;
        clip-path: polygon(
            0% 100%,
            calc(100% - 12px) 100%,
            100% calc(100% - 12px),
            100% 24px,
            calc(100% - 12px) 12px,
            calc(100% - 66px) 12px,
            calc(100% - 80px) 0,
            12px 0,
            0 12px,
            0 calc(100% - 12px),
            12px 100%
        ) !important;
    }
    .mapboxgl-popup-tip {
        border-width: 8px !important;
        filter: drop-shadow(0 4px 8px #ccc) !important;
    }
}

//信息表格
.table-label-content {
    display: grid;
    grid-template-columns: repeat(12, minmax(100px, 1fr));
    border-top: 1px solid var(--border-color-3);
    border-bottom: 1px solid var(--border-color-3);
    border-right: 1px solid var(--border-color-3);
    &-item {
        display: flex;
        grid-column: span 6;
        border-bottom: 1px solid var(--border-color-3);
        margin-bottom: -1px;
        &.item-25 {
            grid-column: span 3;
        }
        &.item-33 {
            grid-column: span 4;
        }
        &.item-75 {
            grid-column: span 8;
        }
        &.item-100 {
            grid-column: span 12;
        }
        &-ll {
            width: 150px;
            min-width: 150px;
            box-sizing: border-box;
            white-space: pre-wrap;
            padding: 12px 24px;
            display: flex;
            align-items: center;
            position: relative;
            background: var(--item-active-color);
            border-left: 1px solid var(--border-color-3);
            border-right: 1px solid var(--border-color-3);
        }
        &-rr {
            padding: 12px 24px;
            word-wrap: break-word;
            word-break: break-all;
            white-space: normal;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
        }
    }
}

.n-dialog {
    padding: 24px 28px;
    .n-dialog__title {
        font-size: 17px;
    }
    .n-dialog__content {
        min-height: 10px;
    }
}

//带箭头的tabs
.n-tabs {
    &.tabs-arrow {
        .n-tabs-nav {
            line-height: 1 !important;
        }
        .n-tabs-bar {
            &::after {
                position: absolute;
                content: '';
                width: 0;
                height: 0;
                border-bottom: 4px solid var(--primary-color);
                border-left: 4px solid transparent;
                border-right: 4px solid transparent;
                bottom: 2px;
                left: 50%;
                transform: translateX(-50%);
            }
        }
    }
}

.n-date-panel-month__text {
    font-weight: 500 !important;
}

//树型菜单匹配结果
.n-tree .n-tree-node.n-tree-node--highlight .n-tree-node-content .n-tree-node-content__text {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.n-empty {
    .n-empty__icon {
        padding-top: 8px;
        width: 200px;
        height: 120px;
        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }
    .n-empty__description {
        font-size: 13px;
    }
}

.n-data-table--bordered {
    .n-data-table-tbody {
        position: relative;
        &::after {
            position: absolute;
            height: 1px;
            width: 100%;
            left: 0;
            bottom: -1px;
            content: '';
            background: var(--border-color);
            transform: scaleY(0.5);
        }
    }
}
